<!--  -->
<template>
<div class="result-item">
  <div class="result-wrap flex">
    <van-image
      width="86px"
      height="55px"
      radius="8px"
      :src="itemObj.goods.thumb"
    />
    <div class="wrap">
      <h3>{{itemObj.goods.title}}</h3>
      <div class="apply">报名学员：{{itemObj.relation_name}}</div>
      <div class="score">
        <div class="score-grade">分数：<span>{{itemObj.score}}</span></div>
        <div class="score-grade" v-if="itemObj.level_name">获奖等级：<span>{{itemObj.level_name}}</span></div>
      </div>
    </div>
  </div>
  <div class="result-btn flex">
    <van-button color="#AAAAB3" 
      round 
      class="regist-btn"
      style="width: 77px;height: 32px;font-weight: 400;font-size: 13px;line-height:13px;color: #00001C;" plain @click="goodsTo(itemObj)"
      v-if="itemObj.event_registration_goods && itemObj.event_registration_goods.value_added_goods_id">增值服务</van-button>
    <van-button color="var(--themeBaseColor)" round style="width: 77px;height: 32px;font-weight: 400;font-size: 13px;line-height:13px;color: #fff;" @click="examineClick(itemObj)">查看证书</van-button>
  </div>
</div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';
import { Image as VanImage } from 'vant';
export default {
  props: {
    itemObj: {
      type: Object,
      default:{}
    }
  },
  name:'',
  //import引入的组件需要注入到对象中才能使用
  components: {VanImage},
  data() {
  return {

  };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    goodsTo(item) {
      this.$router.push(this.fun.getUrl("goods", { id: item.event_registration_goods.value_added_goods_id }));
    },
    examineClick(item) {
      this.$emit('examineClick', {item:item});
    }
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {

  },
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {

  },
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
}
</script>
<style lang="scss" scoped>
/* @import url(); 引入公共css类 */
.result-btn .van-button--normal {
  padding:0;
}
.result-btn ::v-deep .van-button:nth-child(1) {
  margin:0 8px 0 0;
  // color: #00001c !important;
}
.result-btn ::v-deep .regist-btn   {
  color: #00001c !important;
}
@mixin result-item {
  background: #FFFFFF;
  border-radius: 8px 8px 8px 8px;
  padding:10px;
  margin:0 0 10px 0;
}
.result-item {
  @include result-item;
  .result-wrap {
    .wrap {
      text-align: left;
      padding:0 0 0 9px;
      width:72%;
      h3 {
        font-weight: 500;
        font-size: 14px;
        color: #00001C;
      }
      .apply {
        font-weight: 400;
        font-size: 13px;
        line-height: 13px;
        color: #6E6E79;
        padding:3px 0 7px 0;
      }
      .score {
        display: flex;
        .score-grade {
          font-size: 14px;
          line-height: 14px;
          color: #6E6E79;
          flex:0 0 60%;
          &:nth-child(1) {
            flex:0 0 40%;
          }
          span {
            font-weight: bold;
            font-size: 14px;
            color: #F15353;
          }
        }
      }
    }
  }
  .result-btn {
    padding:20px 0 0 0;
    justify-content: flex-end;
  }
  
}
</style>